package milktea.service;

import milktea.dao.PRODUCTDao;
import milktea.dto.PRODUCT_DTO;
import milktea.entity.CART;
import milktea.entity.DETAIL;
import milktea.entity.PRODUCT;

import java.util.ArrayList;
import java.util.List;

public class PRODUCTService {
    public static int insert(PRODUCT p) {
        return PRODUCTDao.insert(p);
    }

    public static ArrayList<PRODUCT> selectAll() {

        return PRODUCTDao.selectAll();
    }

    public static ArrayList<PRODUCT> selectByAllFid(int fid) {
        return PRODUCTDao.selectByAllFid(fid);
    }

    public static ArrayList<PRODUCT> selectByAllCid(int cid) {
        return PRODUCTDao.selectByAllCid(cid);
    }

    public static PRODUCT selectById(int id) {
        return PRODUCTDao.selectById(id);
    }


    public static ArrayList<PRODUCT> selectAllById(ArrayList<Integer> ids) {
        return PRODUCTDao.selectAllById(ids);
    }

    public static int del(int id) {
        return PRODUCTDao.del(id);
    }


    /**
     * @param id
     * @return
     */
    public static PRODUCT selectByID(int id) {

        return PRODUCTDao.selectByID(id);
    }
    public static List<PRODUCT_DTO> Detail_DtoByID(ArrayList<DETAIL> details){
        return PRODUCTDao.Detail_DtoByID(details);
    }
    public static void update_product_num(int PRODUCT_ID,int num){
        PRODUCTDao.update_product_num(PRODUCT_ID,num);
    }
    public static int update(PRODUCT p){return PRODUCTDao.update(p);}
}
